﻿using System.Linq;

namespace Sidvall.LogManager.UI.Entities
{
	public sealed partial class LogScopeItemCollection
	{
		#region Public Members

		#region LoadEventTypes

		public void LoadEventTypes(Sidvall.Data.KeyValueCollection<string, Sidvall.Logging.EventType> eventTypes)
		{
			if (eventTypes == null)
				return;
			foreach (var item in this)
			{
				var eventType = (from o in eventTypes
								 where o.Value == item.EventTypeId
								 select o).FirstOrDefault();
				if (eventType != null)
					item.EventTypeName = eventType.ToString();
			}
		}

		#endregion

		#endregion
	}
}